﻿using Coldairarrow.Business;
using Coldairarrow.Entity.BTB_StaffUsers;
using Coldairarrow.Entity.Order;
using Coldairarrow.Util;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

namespace Coldairarrow.IBusiness.Order
{
    public interface IBTB_RefundMasterBusiness
    {
        Task AddDataAsync(SetRefundOderDTO data);

        Task<PageResult<BTB_RefundDTO>> GetGoodsList(PageInput<BTB_RefundDTO> input);

        Task<PageResult<GetRefundOderDTO>> GetOrdersListAsnyc(PageInput<SearchDTO> input);

        Task<RefundOrderDto> GetTheDataAsnyc(IdInputDTO input);
    }

    public class SearchDTO {
        public string Search { get; set; }

        /// <summary>
        /// 状态检索条件（-1.未通过,-2.退款失败，0.待审核，1.已通过，2.已退款）
        /// </summary>
        public int? State { get; set; }
    }

    public class SetRefundOderDTO 
    { 

        /// <summary>
        /// 订单id
        /// </summary>
        public string OrderId { get; set; }


        /// <summary>
        /// 退款原因类型
        /// </summary>
        public string RTypeId { get; set; }

        /// <summary>
        /// 原因说明
        /// </summary>
        public string Resion { get; set; }

        /// <summary>
        /// 上传图片
        /// </summary>
        public string ImgURL { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Note { get; set; }



    }

    public class GetRefundOderDTO : BTB_RefundMaster
    { 

        /// <summary>
        /// 用户名称
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 用户手机号
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderCode { get; set; }

        /// <summary>
        /// 商品数量
        /// </summary>
        public int? GoodsNum { get; set; }

        /// <summary>
        /// 退款前订单状态
        /// </summary>
        public int? BeforeRefundState { get; set; }

        /// <summary>
        /// 应付金额
        /// </summary>
        public decimal YSMoney { get; set; }

        /// <summary>
        /// 代金金额
        /// </summary>
        public decimal? YHMoney { get; set; }

        /// <summary>
        /// 实收金额
        /// </summary>
        public decimal? SSMoney { get; set; }

    }

    public class RefundOrderDto : OrderProducts
    {
       public BTB_RefundMaster RefundDto { set; get; }

       public BTB_StaffUser UserInfo { set; get; }
    }

    public class SPRefundDTO {
        /// <summary>
        /// 退款列表Id
        /// </summary>
        [Required]
        public string Id { get; set; }

        /// <summary>
        /// 状态（1.通过，其他.未通过）
        /// </summary>
        [Required]
        public int State { get; set; }

        /// <summary>
        /// 未通过原因
        /// </summary>
        public string NoPassResion { get; set; }
    }

}
